home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
language
/
iconv8_e.arc
/
DOCS.ARC
/
IPD136.DOC
< prev
next >
Wrap
Text File
|
1985-11-20
|
19KB
|
661 lines
Version 8 of Icon for the Atari ST
Ralph E. Griswold
Department of Computer Science, The University of Arizona
1.__Introduction
Icon for the Atari ST is designed to run on both the 520 and
1040 models, but the limited amount of memory on the 520 makes
its use there problematical for Version 8, which is larger than
previous versions. Icon for the the Atari ST is designed to run
under a command-line processor, such as ASH. This document
assumes the use of ASH, although other command-line processors
can be used.
Version 8 of Icon for the Atari ST is distributed on a
single-sided diskette, which includes executable binary files,
ASH, a few test programs, and documentation in machine-readable
form. Printed documentation is included with diskettes distri-
buted by the Icon Project at the University of Arizona.
This implementation of Icon is in the public domain and may be
copied and used without restriction. The Icon Project makes no
warranties of any kind as to the correctness of this material or
its suitability for any application. The responsibility for the
use of Icon lies entirely with the user.
2.__Documentation
The basic reference for the Icon programming language is the
book
The Icon Programming Language, second edition, Ralph E.
Griswold and Madge T. Griswold, Prentice-Hall, Inc., Engle-
wood Cliffs, New Jersey, 1990. 365 pages. ISBN 0-13-447889-
4. $29.95.
This book is available from the Icon Project at the University of
Arizona. It also can be ordered through any bookstore that han-
dles special orders or by telephone directly from Prentice-Hall:
(201) 767-9520.
Note that the first edition of this book, published in 1983,
describes an older version of Icon and does not contain informa-
tion about many of the features of Version 8.
A brief overview of Icon is contained in technical report TR
90-6 [1] (tr90-6.doc on the distribution diskette). Features that
have been added to Icon since the book was written are described
in TR 90-1 [2] (tr90-1.doc on the distribution diskette). These
technical reports, together with this document (ipd136.doc on
IPD136 - 1 - April 2, 1990
this diskette), provide enough information to write and run sim-
ple Icon programs, but persons who intend to use Icon extensively
will need the book.
3.__Installing_Icon_on_the_Atari_ST
Two executable binary files are needed to run Icon:
icont.prg translator and linker
iconx.prg executor
These files should be located at a place on the PATH specifica-
tion for your command-line processor. Because of the way path
searching is done, it is advisable to place these files in the
root directory of one of your devices.
Most of the distribution files are packaged in ARC format. A
copy of ARC is included on the distribution diskette. The distri-
bution files are:
arc.prg archiving utility
icon.arc Icon executable binaries [214KB]
samples.arc Icon programs and data [2KB]
docs.arc documents [139KB]
readme installation overview and recent notes
ash.prg ASH
ash.hlp ASH help file
ash.ini ASH initialization file
The figures in brackets give the approximate amount of disk space
needed when the files are extracted from their archives.
First copy arc.prg to a place on your path. To install the
.prg files, set your current directory to the desired place and
dearchive the files using arc on the distribution diskette*. For
example, if the distribution diskette is in drive a:, the follow-
ing will do:
arc x a:icon.arc
The same technique can be used for extracting the remaining
archived files.
__________________________
*If you are not familiar with the capabilities of arc, you
can get a brief summary by
arc h
IPD136 - 2 - April 2, 1990
4.__Running_Icon_on_the_Atari_ST_-_Basic_Information
Files containing Icon programs must have the extension .icn.
Such files should be plain text files (without line numbers or
other extraneous information). The command processor icont runs
icont and ilink to produce an ``icode'' file that can be executed
by iconx. For example, an Icon program in the file prog.icn is
translated and linked by
icont prog.icn
The result is an icode file with the name prog.icx. This file
can be run by
iconx prog.icx
The extensions .icn and .icx are optional. For example, it is
sufficient to use
icont prog
and
iconx prog
If input or output is redirected, i/o redirection must appear
at the beginning of the arguments for iconx, as in
iconx <prog.dat prog
5.__Testing_the_Installation
There are a few programs on the distribution diskette that can
be used for testing the installation and getting a feel for run-
ning Icon:
hello.icn This program prints the Icon version number,
time, and date. Run this test as
icont hello
iconx hello
cross.icn This program prints all the ways that two words
intersect in a common character. The file
cross.dat contains typical data. Run this test
as
IPD136 - 3 - April 2, 1990
icont cross
iconx <cross.dat cross
meander.icn This program prints the ``meandering strings''
that contain all subsequences of a specified
length from a given set of characters. Run this
test as
icont meander
iconx <meander.dat meander
roman.icn This program converts Arabic numerals to Roman
numerals. Run this test as
icont roman
iconx roman
and provide some Arabic numbers from your con-
sole.
If these tests work, your installation is probably correct and
you should have a running version of Icon.
6.__More_on_Running_Icon
For simple applications, the instructions for running Icon
given in Section 4 may be adequate. The icont command processor
supports a variety of options that may be useful in special
situations. There also are several aspects of execution that can
be controlled with environment variables. These are listed here.
If you are new to Icon, you may wish to skip this section on the
first reading but come back to it if you find the need for more
control over the translation and execution of Icon programs.
6.1__Arguments
Arguments can be passed to the Icon program by appending them
to the command line. Such arguments are passed to the main pro-
cedure as a list of strings. For example,
iconx prog text.dat log.dat
runs the icode file prog.icx, passing its main procedure a list
of two strings, "text.dat" and "log.dat". These arguments might
be the names of files that prog.icn reads from and writes to. For
example, the main procedure might begin as follows:
IPD136 - 4 - April 2, 1990
procedure main(a)
in := open(a[1]) | stop("cannot open input file")
out := open(a[2],"w") | stop("cannot open output file")
.
.
.
6.2__The_Command_Processor
The command processor icont can accept several Icon source
files at one time. When several files are given, they are
translated and combined into a single icode file whose name is
derived from the name of the first file. For example,
icont prog1 prog2
translates and links the files